<?php

if(!$page_no)
	$page_no=1;
$MAX=$Small_box_end;
$MAX=9;
$lastrow=$MAX+$page_no;
if(!next_page)
	$next_page=1;
$next_page=$next_page+1;

$imgSr=$page_no;

if(!$image_id)
echo '<script>window.location.href="index.php?show=gallery";</script>';


//$qry="select b.* from bid as b left join bid_details as d on b.id=d.item_id where b.deleted='N' and b.id!='$pro_id' and b.status='Y' and b.start='Y'";

$qry="select b.*, d.* from albumdetail as b left join album as d on b.id_album=d.id_album where b.id_gambar='$image_id'";

//$qry="select * from koleksi ".$condition."order by id desc";
	$lim_min = ($page_no-1)*$MAX;
 
	$Qry="$qry limit $lim_min,$MAX"; 
	$sqlResult=$dbh->query($Qry);
		
	$total_row=$dbh->query($qry);
	$TOTAL_RECORDSET=mysql_num_rows($total_row);

	
		
$all_item_list='<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><td>
	<table width="100%" border="0" cellspacing="3" cellpadding="0">
  <tr>';
  
  $i=0;	
 if($TOTAL_RECORDSET>0)
  { 	
while($sqlRow=@mysql_fetch_object($sqlResult))
{
	$judulcoll=$sqlRow->nama;
// DESKRIPSI COLLECTION
$typeofwood=$sqlRow->typeofwood;
if ($typeofwood=='EOW')
$typeofwood='European Oak Wood';
if ($typeofwood=='RTW')
$typeofwood='Reclaimed Teak Wood';
if ($typeofwood=='VTW')
$typeofwood='Village Teak Wood';
	$deskripsicoll=$typeofwood;
if ($sqlRow->indoor=='Y')
	$indoor='Indoor Use<br/>';
if ($sqlRow->outdoor=='Y')
	$outdoor='Outdoor Use<br/>';


$id_album=$sqlRow->id_album;
$imglarge=$sqlRow->image;
$deskripsi=$sqlRow->deskripsi;
$image='<img src="assets/albumdetail/'.$imglarge.'" alt="'.$nama_gambar.'" width="410" height="307">';
$nama_gambar=$sqlRow->nama_gambar;
$nama_album=$sqlRow->nama_album;
$product_details='<p><strong>'.$nama_gambar.'</strong><br>
      <a href="index.php?show=album&id='.$id_album.'">'.$nama_album.'</a><br>
      '.$typeofwood.'<br>'.$indoor.$outdoor.$fsclabel.'
    </p>
    <p>'.$deskripsi.'</p>';

		
if($i%3==0)
	{
       $all_item_list.='</tr>
</table>
</td>
  </tr>
  <tr><td height="5"></td></tr>
  <tr><td>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>';

	}
		
$all_item_list.='<td>&nbsp;</td><td width="172">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td align="center"><a href="index.php?show=detail&product='.$product_id.'"><img border="0" src="assets/product/'.$thumb.'" /></td>
  </tr>
    <tr>
    <td align="center">'.$nama.'</td>
  </tr>
</table>
</td>
<td>&nbsp;</td>';
	
$i++;
		}
		
}
else
{
 $all_item_list.='<td align="center" class="headning_empty ">NO RECORD </td>';
}
	
	$all_item_list.='</tr>
</table>
</td>
  </tr></tr></table>';


//=====================Starting Pagination From Here==========================
	
	//global $my_page_name;
	$my_page_name="./index.php?show=product&coll=".$coll;
	include("pagination.inc");

//=====================Ending Pagination Here==========================	
//$fieldname="cat_name".$_SESSION['LANG']; 
//$Res=$dbh->query("select $fieldname,id from category where status='Y' and deleted='N' order by $fieldname");
//while($Data=@mysql_fetch_array($Res))
//	{
	
//	$qry12="select * from bid where status='Y' and start='Y' and deleted='N' and end_bid='Y' and category='$Data[1]' and auction_type!='P' order by end_bid desc,extends_time";
//		$total_row12=$dbh->query($qry12);
//		$TOTAL_RECORDSET12=mysql_num_rows($total_row12);
//		if($TOTAL_RECORDSET12==0)
//		{
//			continue;
//		}
		
//	if($pro_box==$Data[1])
//		$category_option.='<option value='.$Data[1].' selected>'.$Data[0].'</option>';
//	else 
//		$category_option.='<option value='.$Data[1].'>'.$Data[0].'</option>';
//	}		
?>